package com.zzq.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zzq.domain.entity.SmilePhotographerDividendBill;
import com.zzq.mapper.SmilePhotographerDividendBillMapper;
import com.zzq.service.SmilePhotographerDividendBillService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzq.util.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 小布
 * @since 2023-10-07
 */
@Service
public class SmilePhotographerDividendBillServiceImpl extends ServiceImpl<SmilePhotographerDividendBillMapper, SmilePhotographerDividendBill> implements SmilePhotographerDividendBillService {


    @Autowired
    SmilePhotographerDividendBillMapper photographerDividendBillMapper;
    @Override
    public List<SmilePhotographerDividendBill> getBillListByPhotographerId(Long photographerId,Boolean withdrawalStatus) {
        LambdaQueryWrapper<SmilePhotographerDividendBill> queryWrapper=new LambdaQueryWrapper<>();
        queryWrapper.eq(SmilePhotographerDividendBill::getPhotographerId,photographerId);
        queryWrapper.eq(!ObjectUtils.isEmpty(withdrawalStatus),SmilePhotographerDividendBill::getWithdrawalStatus,withdrawalStatus);
        List<SmilePhotographerDividendBill> smilePhotographerDividendBills = photographerDividendBillMapper.selectList(queryWrapper);
        return smilePhotographerDividendBills;
    }

    @Override
    public List<SmilePhotographerDividendBill> getBillListByPhotographerId(Long photographerId) {
        return getBillListByPhotographerId(photographerId,null);
    }
}
